package com.cn.lottery;

import com.cn.lottery.domain.PrizeDO;

/**
 * 奖品类
 * @version:1.0
 */
public class Gift implements Comparable<Gift>{
	
	private int id;
	private int sequence;
	private String name;
	private int pool_size;
	private PrizeDO prize;
	private int max_num;
	private double probability;

	public Gift(int id,int sequence,String name,int pool_size, int max_num,PrizeDO prize,double probability) {
		this.id = id;
		this.sequence = sequence;
		this.name = name;
		this.pool_size = pool_size;
		this.prize = prize;
		this.max_num = max_num;
		this.probability = probability;
	}
	
	public void getPool(){
		Integer resPool = this.prize.getResiduePool();
		this.prize.setResiduePool((resPool-1));
//		System.out.println("第"+this.prize.getResiduePool()+"次中奖,中奖概率"+this.probability);
	}
	
	public PrizeDO getPrize() {
		return prize;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getPool_size() {
		return pool_size;
	}

	public int getMax_num() {
		return max_num;
	}

	public double getProbability() {
		return probability;
	}

	public int getResidue_pool() {
		return this.prize.getResiduePool();
	}

	public int getSequence() {
		return sequence;
	}

	public String getName() {
		return name;
	}

	public int compareTo(Gift o) {
		return this.pool_size - o.getPool_size();
	}


}